from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtGui import QIcon
import sys


class InitWindow(QMainWindow):
    def __init__(self):
        """
        描述：初始化主窗口程序
        功能：设置程序图标，设置初始化大小，设置标题栏，
            加载算法模型，载入其他模块
        参数：无
        返回值：无
        """
        super(InitWindow, self).__init__()
        self.setObjectName('MainWindow')
        self.setWindowIcon(QIcon('static/imgs/logo.jpg'))
        self.setWindowTitle('基于图像分割的数据集标注系统')

        desktop = QApplication.desktop()
        screenWidth = desktop.width()
        screenHeight = desktop.height()
        self.mainWindowWidth = int(screenWidth / 1.5)
        self.mainWindowHeight = int(screenHeight / 1.5)
        self.setGeometry(int(screenWidth / 4.5), int(screenHeight / 4.5),
                         self.mainWindowWidth, self.mainWindowHeight)
        # 获取桌面屏幕信息，初始化程序窗口大小



    def windowShow(self):
        """
        描述：窗口展示
        功能：主程序窗口运行
        参数：无
        返回值：无
        """
        self.show()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    main_window = InitWindow()
    main_window.windowShow()
    sys.exit(app.exec_())